<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    #pp{
        color: #ea1414;
    }
</style>
<body>
    <div id=pp><h3>456</h3></div>
    
    <div id=pp><h3>456</h3></div>
    <!-- <script>
        alert("asd")
     </script> -->
     <!-- <p onclick="alert(123)">点我啊~</p> -->
     <!-- <a href="javascript:alert(123)">点我</a> -->

</body>
<script>
    // let name = "ert"
    // let li = [1,2,3,4,5,6]
    // li[20] = 9
    // li["rt"] = "ryu"
    // console.log(name)
    // console.log(li,li["rt"])
    // let ab = {
    //     id:2,
    //     tt:5

    // }
    // console.log(ab,ab.id,ab.tt)
    // let op = 8
    // switch(op){
    //     case 6:console.log("是");break;
    //     case 7:console.log("是");break;
    //     default:
    //         console.log("不对");break;
// }
    // let i = 100
    // do{
    //     console.log(i);
    //     i++

    // }while(i<10)
// let arr = [12,34,56,78,90]
// for (let index in arr){
//     console.log(arr[index]);
// }
// let pp = document.getElementById("pp")
// console.log(pp);
// let pp = document.querySelector("#pp")
// console.log(pp);
let pp = document.querySelector("#pp");
pp.setAttribute("style","color:green;") // 设置
let attr = pp.getAttribute("style") // 获得
console.log(attr);


</script>
</html>